<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="referrer" content="never">
    <title>hover</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        ul {
            list-style: none;
        }

        .box {
            width: 342px;
            margin: 50px auto;
            border: 1px solid #f00;
            overflow: hidden;
        }

        ul,img {
            float: left;
        }

        img {
            width: 200px;
            height: 320px;
            border-left: 1px solid #f00;
            border-right: 1px solid #f00;
        }

        ul li {
            width: 70px;
            line-height: 35px;
            text-align: center;
            border-bottom: 1px solid #f00;
            cursor: pointer;
        }

        ul li:last-child {
            border-bottom: none;
        }

        .act {
            color: #fff;
            background-color: #f00;
        }
    </style>
</head>
<body>
    <div class="box">
        <ul class="left">
        </ul>
        <img src="../lib/image/jQuery/hover/冬裙.jpg" alt="">
        <ul class="right"></ul>
    </div>

    <script src="../lib/data/jqimg.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script type="text/javascript">
        console.log(arr);

        var str = "";
        for(var i = 0; i < arr.length; i ++){
            str += `<li>${ arr[i] }</li>`;
            if(i == 8){
                $("ul.left").html(str);
                str = "";
            }
        }

        $("ul.right").html(str);


        $(".box").on("mouseenter", "li", function(){
            // 更改激活样式
            $(".box .act").removeClass("act");
            $(this).addClass("act");
            // $(this).addClass("act").siblings().removeClass("act");

            $("img").prop("src", "../lib/image/jQuery/hover/"+ this.innerText +".jpg");
        })

        $(".box").on("mouseleave", function (){
            $(".box .act").removeClass("act");
        })
    </script>
</body>
</html>